    set -xe \
    && echo "构建依赖" \
    && buildDeps=" \
    build-essential \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng12-dev \
    git gcc make \
    " \
    && echo "运行依赖" \
    && runtimeDeps=" \
    libfreetype6 \
    libjpeg62-turbo \
    libmcrypt4 \
    libpng12-0 \
    libmcrypt-dev \
    libreadline-dev \
    bzip2 \
    libmagickwand-dev \
    libevent-dev \
    " \
    && echo "安装 php 以及编译构建组件所需包" \
    && DEBIAN_FRONTEND=noninteractive \
    && apt-get update \
    && apt-get install -y ${runtimeDeps} ${buildDeps} --no-install-recommends \
    && echo "编译安装 php 组件" \
    && docker-php-ext-install iconv mysqli pdo pdo_mysql zip opcache pcntl posix \
    && docker-php-ext-configure mcrypt  --with-mcrypt \
    && docker-php-ext-install mcrypt \
    && docker-php-ext-configure gd \
    --with-freetype-dir=/usr/include/ \
    --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install gd \
    && git clone https://github.com/expressif/pecl-event-libevent.git
    && cd pecl-event-libevent \
    && phpize \
    && ./configure \
    && make \
    && make install && docker-php-ext-enable libevent \
    && pecl install imagick && docker-php-ext-enable imagick \
    && pecl install xdebug && docker-php-ext-enable xdebug \
    && echo "清理" \
    # && apt-get purge -y --auto-remove \
    #     -o APT::AutoRemove::RecommendsImportant=false \
    #     -o APT::AutoRemove::SuggestsImportant=false \
    #     $buildDeps \
    && rm -rf /var/cache/apt/* \
    && rm -rf /var/lib/apt/lists/*